#include <vector>
#include <iostream>

using namespace std;

class Solution {
public:
    vector<int> diffWaysToCompute(string input) {
        vector<int> res;
        for (int i = 0; i < input.size(); i++) {
            if (input[i] == '+' || input[i] == '-' || input[i] == '*') {
                vector<int> res1 = diffWaysToCompute(input.substr(0, i));
                vector<int> res2 = diffWaysToCompute(input.substr(i + 1));
                if (input[i] == '+') {
                    for (int item1 : res1) {
                        for (int item2 : res2) {
                            res.push_back(item1 + item2);
                        }
                    }
                } else if (input[i] == '-') {
                    for (int item1 : res1) {
                        for (int item2 : res2) {
                            res.push_back(item1 - item2);
                        }
                    }
                } else {
                    for (int item1 : res1) {
                        for (int item2 : res2) {
                            res.push_back(item1 * item2);
                        }
                    }
                }
            }
        }
        if (res.size() == 0) {
            res.push_back(atoi(input.data()));
        }
        return res;
    }
};